
import {kuaidi_search} from '../../../../utils/util.js'
var app=getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    order_list:{
      type:Array,
      value:[]
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    status_list:[
      {status:"待付款",status_id:'0'},
      {status:"待发货",status_id:'1'},
      {status:"待收货",status_id:'2'},
      {status:"已完成",status_id:'3'},
      {status:"退款中",status_id:'4'},
      {status:"已退款",status_id:'5'},
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    chooseOrder(e){
      let id = e.currentTarget.dataset.id;
      let index = e.currentTarget.dataset.index;
      app.globalData.cur_product_buy=this.data.order_list[index]
      wx.navigateTo({
        url: '/pages/module/orderDetail/orderDetail?id='+id,
      })
    },
    pay(e){
      
      let index = e.currentTarget.dataset.index;
      console.log(index)
      this.triggerEvent('pay',{index:index})
    },
	bake(e){
	  let id = e.currentTarget.dataset.id;
	  wx.setClipboardData({
		  data:id,
		  success:function(res){
			  wx.showToast({
			        title: '复制成功',
			      })
		  }
	  })
	},
	// logistics(e){
	// 	//console.log(e);
	// 	//kuaidi_search_byorderno('PDD','200912-257243220540291','88389851472','')
	// },
    cancle(e){
      let index = e.currentTarget.dataset.index;
      this.triggerEvent('cancle',{index:index})
    },
    confirm(e){
      let index = e.currentTarget.dataset.index;
      this.triggerEvent('confirm',{index:index})
    },
    refund(e){
      let index = e.currentTarget.dataset.index;
      wx.navigateTo({
        url: '/pages/module/refund/refund',
        success: function(res) {
          res.eventChannel.emit('acceptDataFromOpenerPage', { id: index })
        }
      })
    },
    order(e){
     console.log(e);
   // kuaidi_search();e.currentTarget.dataset.index.p
      

    }
  }
})
